﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ArtOfTest.WebAii.Silverlight.UI;
using ArtOfTest.WebAii.Win32.Dialogs;
using ArtOfTest.WebAii.Controls.HtmlControls;

namespace SM2Panel
{
    public class EditPanelDialog
    {
        public static void setName(int intPositionPanel, string strName)
        {
            Utilities.GlobalObject.SILVERLIGHTAPP.RefreshVisualTrees();
            IList<TextBox> iListTextbox = Utilities.GlobalObject.SILVERLIGHTAPP.Find.AllByName<TextBox>("txtName");
            TextBox tb = iListTextbox[intPositionPanel];
            SM2Input.Silverlight.TypeTextBox(tb, strName);
        }

        public static void setChartType(int intPositionPanel, string strName)
        {
            Utilities.GlobalObject.SILVERLIGHTAPP.RefreshVisualTrees();
            IList<ComboBox> iListComboBox = Utilities.GlobalObject.SILVERLIGHTAPP.Find.AllByName<ComboBox>("comboChartType");
            ComboBox cbb = iListComboBox[intPositionPanel];
            SM2Input.Silverlight.SelectComboBox(cbb, strName);
        }

        public static void setProfile(int intPositionPanel, string strName)
        {
            Utilities.GlobalObject.SILVERLIGHTAPP.RefreshVisualTrees();
            IList<ComboBox> iListComboBox = Utilities.GlobalObject.SILVERLIGHTAPP.Find.AllByName<ComboBox>("comboOrganization");
            ComboBox cbb = iListComboBox[intPositionPanel];
            SM2Input.Silverlight.SelectComboBox(cbb, strName);
        }

        public static void setCategory(int intPositionPanel, string strName)
        {
            IList<ComboBox> iListComboBox = Utilities.GlobalObject.SILVERLIGHTAPP.Find.AllByName<ComboBox>("comboCategory");
            ComboBox cbb = iListComboBox[intPositionPanel];
            SM2Input.Silverlight.SelectComboBox(cbb, strName);
        }

        public static void clickApply(int intPositionPanel)
        {
            Utilities.GlobalObject.SILVERLIGHTAPP.RefreshVisualTrees();
            IList<Button> iListButton = Utilities.GlobalObject.SILVERLIGHTAPP.Find.AllByName<Button>("btnApply");
            Button btn = iListButton[intPositionPanel];
            SM2Input.Silverlight.ClickButton(btn);
        }
    }
}
